/*     */ package com.lmpop.trade.ti_casepre;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_casepreInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_casepreInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_casepre ti_casepre = new Ti_casepre();
/*  26 */     ti_casepre.setId(map.getString("id"));
/*  27 */     ti_casepre.setTittle(map.getString("tittle"));
/*  28 */     ti_casepre.setContent(map.getString("content"));
/*  29 */     ti_casepre.setArea_name(map.getString("area_name"));
/*  30 */     ti_casepre.setIn_date(map.getString("in_date"));
/*  31 */     ti_casepre.setState(map.getString("state"));
/*  32 */     ti_casepre.setSrc_url(map.getString("src_url"));
/*     */ 
/*  34 */     String result_code = "0";
/*     */     try {
/*  36 */       insert(dbmMgr, ti_casepre);
/*     */     } catch (ApplicationException e) {
/*  38 */       e.printStackTrace();
/*  39 */       result_code = "1";
/*     */     }
/*  41 */     map.setString("result_code", result_code);
/*  42 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_casepre ti_casepre)
/*     */     throws ApplicationException
/*     */   {
/*  51 */     dbmMgr.update("insertTi_casepre", ti_casepre);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  61 */     String pkid_string = map.getString("pkid");
/*  62 */     String result_code = "0";
/*     */     try {
/*  64 */       if (!pkid_string.equals("")) {
/*  65 */         String[] pkStr = pkid_string.split("\\|");
/*  66 */         for (int i = 0; i < pkStr.length; i++) {
/*  67 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  71 */       e.printStackTrace();
/*  72 */       result_code = "1";
/*     */     }
/*  74 */     map.setString("result_code", result_code);
/*  75 */     return map;
/*     */   }
/*     */ 
/*     */   public SysMap alterStates(DbmInterf dbmMgr, SysMap map) {
/*  79 */     String pkid_string = map.getString("pkid");
/*  80 */     String result_code = "0";
/*     */     try {
/*  82 */       if (!pkid_string.equals("")) {
/*  83 */         String[] pkStr = pkid_string.split("\\|");
/*  84 */         Ti_casepre casepre = new Ti_casepre();
/*  85 */         for (int i = 0; i < pkStr.length; i++) {
/*  86 */           casepre.setId(pkStr[i]);
/*  87 */           casepre.setState(map.getString("state"));
/*  88 */           if (pkStr[i].equals("")) continue; update(dbmMgr, casepre);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  92 */       e.printStackTrace();
/*  93 */       result_code = "1";
/*     */     }
/*  95 */     map.setString("result_code", result_code);
/*  96 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 105 */     dbmMgr.update("deleteTi_casepre", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 114 */     Ti_casepre ti_casepre = new Ti_casepre();
/* 115 */     ti_casepre.setId(map.getString("id"));
/* 116 */     ti_casepre.setState(map.getString("state"));
/* 117 */     String result_code = "0";
/*     */     try {
/* 119 */       update(dbmMgr, ti_casepre);
/*     */     } catch (ApplicationException e) {
/* 121 */       e.printStackTrace();
/* 122 */       result_code = "1";
/*     */     }
/* 124 */     map.setString("result_code", result_code);
/* 125 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_casepre ti_casepre)
/*     */     throws ApplicationException
/*     */   {
/* 134 */     dbmMgr.update("updateTi_casepre", ti_casepre);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 144 */     Hashtable ti_casepre = (Hashtable)obj;
/* 145 */     if (start == 0)
/* 146 */       start = 0;
/*     */     else {
/* 148 */       start = (start - 1) * limit;
/*     */     }
/* 150 */     ti_casepre.put("start", Integer.valueOf(start));
/* 151 */     ti_casepre.put("limit", Integer.valueOf(limit));
/* 152 */     List list = this.queryList.getList("getListByTi_caseprePage", ti_casepre);
/* 153 */     return list;
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 164 */     Hashtable ti_casepre = (Hashtable)obj;
/* 165 */     List list = this.queryList.getList("getCountByObjTi_casepre", ti_casepre);
/* 166 */     int count = 0;
/* 167 */     if ((list != null) && (list.size() > 0)) {
/* 168 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 169 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 170 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 173 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 183 */     return this.queryList.getList("getTi_casepreByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_casepre.Ti_casepreInfo
 * JD-Core Version:    0.6.0
 */